<div class='form-group'>
    <div class='col-sm-offset-1 col-sm-10'>
        <div class="page-header">
            <h1>
                Les Visiteurs
            </h1>
        </div>
        <table class='table table-hover table-responsive table-striped'>
            <thead>
                <tr>
                    <th>Id</th>
                    <th>Nom</th>
                    <th>Prenom</th>
                    <th>Adresse</th>
                    <th>Code Postale</th>
                    <th>Ville</th>
                    <th>Embauche</th>
                    <th>Langues</th>
                </tr>
            </thead>
            <?php foreach ($this->paginator as $visiteur) : ?>
                <tbody>
                    <tr>
                        <?php // echo var_dump($visiteur) ?>
                        <td> <?php echo $visiteur->id ?>   </td>
                        <td> <?php echo $visiteur->nom ?>   </td>
                        <td> <?php echo $visiteur->prenom ?>   </td>
                        <td> <?php echo $visiteur->adresse ?>   </td>
                        <td> <?php echo $visiteur->cp ?>   </td>
                        <td> <?php echo $visiteur->ville ?>   </td>
                        <td> <?php echo $visiteur->dateEmbauche ?>   </td>
                        <?php if ($visiteur->getNblanguesParlees() > 0) { ?>
                            <td>
                                <div class="btn-group">
                                    <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
                                        <?php echo $visiteur->getNblanguesParlees() . " langues " ?>
                                        <span class="caret"></span>
                                    </button>
                                    <ul class="dropdown-menu">
                                        <?php
                                        foreach ($visiteur->getlanguesParlees() as $langue) {
                                            ?>
                                            <li><a href="#"><?php echo $langue->language ?></a></li>
                                            <?php
                                        }
                                        ?>
                                    </ul>
                                </div>
                            </td>
                            <?php
                        } else {
                            echo '<td>N/A</td>';
                        }
                        ?> 
                    </tr>
                </tbody>
            <?php endforeach; ?>
        </table>
    </div>
</div>
<div class="form-group">
    <div class='col-sm-offset-5'>
        <ul class="pagination">
            <?php
            $pages = $this->paginator->getPages();
            if ($pages->first != $pages->current) {
                ?>
                <li><a href="?page=<?php echo $pages->firstPageInRange ?>">&laquo;</a></li>
                <?php
            }
            if (isset($pages->previous)) {
                ?>
                <li><a href="?page=<?php echo $pages->previous ?>"><</a></li>
                <?php
            }
            foreach ($pages->pagesInRange as $page) {
                ?>
                <li><a href="?page=<?php echo $page ?>"><?php echo $page ?></a></li>
                <?php
            }
            if (isset($pages->next)) {
                ?>
                <li><a href="?page=<?php echo $pages->next ?>">></a></li>
                <?php
            }
            if ($pages->last != $pages->current) {
                ?>
                <li><a href="?page=<<?php echo $pages->lastPageInRange ?>">&raquo;</a></li>
                <?php
            }
            ?>
        </ul>
    </div>
</div>